package com.leetcode.algorithm.y22.m07;

/**
 * 1603. 设计停车系统
 * 
 * https://leetcode.cn/problems/design-parking-system/
 * 
 * @author jie.deng
 *
 */
class ParkingSystem {

	private int[] parkingArr = new int[3];

	public ParkingSystem(int big, int medium, int small) {
		parkingArr[0] = big;
		parkingArr[1] = medium;
		parkingArr[2] = small;
	}

	public boolean addCar(int carType) {
		if (parkingArr[carType - 1] > 0) {
			parkingArr[carType - 1]--;
			return true;
		}
		return false;
	}
    
}

/**
 * Your ParkingSystem object will be instantiated and called as such:
 * ParkingSystem obj = new ParkingSystem(big, medium, small);
 * boolean param_1 = obj.addCar(carType);
 */